package com.example.web1;
import com.example.web1.dao.User;
import com.example.web1.dao.User2;
import com.example.web1.entity.conUser;
import com.example.web1.entity.webUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;

@SpringBootApplication
@RequestMapping
@Controller
public class Web1Application {

    @Autowired
    User2 user2;
    @Autowired
    User user;

    @RequestMapping
    public String index(Model mod){
        List<conUser> list1=user2.list1();
        mod.addAttribute("list1", list1);
        List<webUser> list=user.list();
        mod.addAttribute("list", list);
        return "index";
    }



    public static void main(String[] args) {
        SpringApplication.run(Web1Application.class, args);
    }

}
